package com.example.park2212.adapter

import android.graphics.Color
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.lib_base.entity.VisitStatusBean
import com.example.park2212.R

class VisitStatusAdapter:BaseQuickAdapter<VisitStatusBean,BaseViewHolder>(R.layout.item_status) {
    override fun convert(helper: BaseViewHolder, item: VisitStatusBean) {
        helper.setText(R.id.vis_status,item.status)
        val tv = helper.getView<TextView>(R.id.vis_status)
        tv.setText(item.status)
        if (item.isCheck){
            tv.setBackgroundResource(R.drawable.shape_solid_darkgreen)
            tv.setTextColor(Color.YELLOW)
        }else{
            tv.setBackgroundResource(R.drawable.shape_status)
            tv.setTextColor(Color.BLUE)
        }
    }
}